import request from '../utils/request'

// 获取user页面个人信息
const getUserInfoAPI = () => {
  return request({
    url: '/v1_0/user'
  })
}

// 获取编辑资料页面信息
const getUserProfileAPI = () => {
  return request({
    url: '/v1_0/user/profile'
  })
}
// 更新头像
const updatePhotoAPI = ({ form }) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data: form
  })
}

// 更新姓名和生日
const updateProfileAPI = ({ birthday, name }) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data: {
      birthday,
      name
    }
  })
}

export {
  getUserInfoAPI,
  getUserProfileAPI,
  updatePhotoAPI,
  updateProfileAPI
}
